/*
 * 使用示例:
 * app.use(compress());
 */
'use strict';

const compress = require('koa-compress');

exports = module.exports = () => {
  return compress({
    filter: function(content_type) {
      return /text/i.test(content_type)
    },
    threshold: 2048,
    flush: require('zlib').Z_SYNC_FLUSH
  });
};